#include "nr_core.h"

nr_object::nr_object(QObject *parent)
    : QObject(parent)
    , m_type(NR_OBJECT_UNKNOWN)
{

}

nr_object::nr_object(nr_object_type_t type, QObject *parent)
    : m_type(type)
    , QObject(parent)
{

}

nr_object::~nr_object()
{

}

nr_object::value_type_t nr_object::parser_value_type(const QString& type_str)
{
    const QString str_value_types[] = {"Invalid",
        "Bool",
        "Int",
        "UInt",
        "LongLong",
        "ULongLong",
        "Double",
        "Char",
        "Map",
        "List",
        "String",
        "StringList",
        "ByteArray",
        "BitArray",
        "Date",
        "Time",
        "DateTime",
        "Url",
        "Locale",
        "Rect",
        "RectF",
        "Size",
        "SizeF",
        "Line",
        "LineF",
        "Point",
        "PointF",
        "Hash"};
    
    for(int i = 0; i < NR_ARRAY_SIZE(str_value_types); ++i)
    {
        if (type_str.compare(str_value_types[i], Qt::CaseInsensitive) == 0)
        {
            return (value_type_t)i;
        }
    }

    return nr_object::Invalid;
}